unit FormSintegra2004;

interface

uses
  Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Mask, StdCtrls, Buttons;

type
  TSintegra2004 = class(TForm)
    Label1: TLabel;
    Edit1: TEdit;
    Label2: TLabel;
    MaskEdit1: TMaskEdit;
    Label14: TLabel;
    MaskEdit2: TMaskEdit;
    Label3: TLabel;
    Label15: TLabel;
    Label4: TLabel;
    Edit2: TEdit;
    Label5: TLabel;
    Edit3: TEdit;
    Label6: TLabel;
    Edit4: TEdit;
    Label7: TLabel;
    Edit5: TEdit;
    Label8: TLabel;
    Edit6: TEdit;
    Label9: TLabel;
    Edit7: TEdit;
    Label10: TLabel;
    MaskEdit3: TMaskEdit;
    Label11: TLabel;
    MaskEdit4: TMaskEdit;
    Label12: TLabel;
    MaskEdit5: TMaskEdit;
    Label13: TLabel;
    Edit8: TEdit;
    Label16: TLabel;
    MaskEdit6: TMaskEdit;
    Label17: TLabel;
    Label18: TLabel;
    MaskEdit7: TMaskEdit;
    Label19: TLabel;
    BitBtn1: TBitBtn;
    Estado: TLabel;
    Edit9: TEdit;
    procedure BitBtn1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Sintegra2004: TSintegra2004;

implementation

uses principal, funcoesapoio, declaracoes, Retorno;

{$R *.dfm}

procedure TSintegra2004.BitBtn1Click(Sender: TObject);
var tipo:integer;
begin

        FormPrincipal.Statusbar1.Panels[0].Text:='Arquivo Sintegra 2004'; WaitProcess;

        FormPrincipal.Memo1.Lines.Add('Arquivo Sintegra 2004:'+inttostr(Resposta));
        FormPrincipal.Memo1.Lines.Add('');

        tipo:=63;
        Resposta:=ECF_ArquivoSintegra2004MFD(tipo, edit1.text, maskEdit1.Text,maskEdit2.text, maskEdit6.Text, maskEdit7.text,edit2.text,edit3.text,edit4.text,edit5.text,edit6.text,edit7.text,Edit9.Text,maskEdit3.Text, maskedit4.text,maskEdit5.text,edit8.text);

        VerificaRetornoFuncao(Resposta);

        if Resposta = 1 then
                if MessageDlg('Deseja abrir o arquivo SINTEGRA.TXT?', mtConfirmation, [mbYes, mbNo], 0) = mrYes then begin
                      FormPrincipal.OpenDialog1.FileName:='SINTEGRA.TXT' ;
                      FormPrincipal.OpenDialog1.Execute;
                      FormRetorno.Caption:=FormPrincipal.OpenDialog1.FileName;
                      FormRetorno.RichEdit1.Lines.LoadFromFile(FormPrincipal.OpenDialog1.FileName);
                      FormRetorno.Show;
                end;

end;

end.
